package com.sqx.modules.app.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 用户
 */
@Mapper
public interface UserDao extends BaseMapper<UserEntity> {

    /*
     * 获取所有师傅和商家信息
     * */
    List<UserEntity> getMasterAndShop();


    IPage<UserEntity> selectUserPage(Page<UserEntity> page, String search, Integer sex, String platform, String sysPhone, Integer status, Long companyId, Integer isAuthentication, String userName, String phoneAndUserName, Integer isCompany, Integer shopType, String companyName, String invitationCode, String inviterCode, Integer isVip);

    List<UserEntity> selectUserList(@Param("search") String search, @Param("sex") Integer sex, @Param("platform") String platform, @Param("sysPhone") String sysPhone, @Param("status") Integer status, @Param("companyId") Long companyId, @Param("isAuthentication") Integer isAuthentication, @Param("userName") String userName, @Param("phoneAndUserName") String phoneAndUserName, @Param("isCompany") Integer isCompany, @Param("invitationCode") String invitationCode, @Param("inviterCode") String inviterCode, Integer isVip);

    int queryInviterCount(@Param("inviterCode") String inviterCode);

    int queryUserCount(@Param("type") int type, @Param("date") String date);

    Double queryPayMoney(@Param("type") int type, @Param("date") String date);

    IPage<Map<String, Object>> queryCourseOrder(Page iPage, @Param("type") int type, @Param("date") String date);

    int userMessage(String date, int type);

    int insertUser(UserEntity userEntity);

    IPage<Map<String, Object>> takingOrdersMessage(Page<Map<String, Object>> iPage, @Param("type") Long type, @Param("date") String date);

    int updateUserClientIdIsNull(String clientid);

    IPage<UserEntity> getWorkerUserList(@Param("pages") Page<UserEntity> pages, @Param("companyId") Long companyId, @Param("sex") Integer sex, @Param("workStatus") Integer workStatus, @Param("phone") String phone, @Param("userName") String userName);

    int cancelStaffUser(String phone);

    List<UserEntity> selectAuthUserList();
}
